import pandas as pd

def excel_read(filename):
    file = pd.read_excel(filename)
    print(file)
    dict= file.to_dict('records')
    #转成列表
    row_to_list=file.values.tolist()
    print(row_to_list)
    print ('12345678', type (dict))
    return dict


if __name__ == '__main__':
    filename = r'C:\peipei_study\接口自动化\examples\excel_testcase\testcaselogin.xlsx'
    data = excel_read(filename)
    #accounts = data['data']['accounts']
    print(data)